﻿using aier.business.logic;
using aier.dataaccess.model;
using log4net;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;

namespace aier.wx.api.selfhost.Controllers
{
    //[Authorize]
    /// <summary>
    /// 
    /// </summary>
    [RoutePrefix("api/ScreenType")]
    public class ScreenTypeController : ApiController
    {
        public ILog log { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public ScreenTypeBll screenTypeBll { get; set; }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public IHttpActionResult Get() {
           
            try
            {
                var types = screenTypeBll.GetScreenTypes();
                return Ok(types);

            }
            catch (Exception ex)
            {
                log.Error(ex.Message, ex);
                return new ApiErrorResult(ex.Message, Request);

            }
        }
    }
}
